/*
* @Author: Administrator
* @Date:   2018-09-12 18:25:18
* @Last Modified by:   Administrator
* @Last Modified time: 2018-09-12 20:07:54
*/
import axios from 'axios';
import * as constants from './constants.js';

const getDetail = (result) => ({
	type: constants.GET_DETAILS,
  title: result.title,
  content: result.content
})

export const getDetails = (id) => {
	return  (dispatch) => {
		 axios.get('/api/details.json?id=' + id).then((res) => {
		 const result = res.data.data;
		 dispatch(getDetail(result));
  })
	}
}
